package com.example.sxmall.dao.mapper;

import com.example.sxmall.dao.pojo.Comments;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentsMapper {
    /**
     * 查看评论列表
     * @return
     */
    public List<Comments> listComments();

    /**
     * 根据ID查询
     * @param cid
     * @return
     */
    public Comments findCommentsById(@Param("cid") Integer cid);

    /**
     * 根据鞋子ID查询评论
     * @param c_sid
     * @return
     */
    public List<Comments> findCommentsBySid(@Param("c_sid") Integer c_sid);

    /**
     * 添加
     * @param comments
     * @return
     */
    public int insertComments(@Param("comments") Comments comments);

    /**
     * 删除
     * @param cid
     * @return
     */
    public int deleteComments(@Param("cid") int cid);

    /**
     * 动态修改
     * @param comments
     * @return
     */
    public int updateComments(@Param("comments") Comments comments);
}
